import { createRouter, createWebHistory } from "vue-router";
import SignIn from "@/views/SignIn.vue";
import SignUp from "@/views/SignUp.vue";
import Profile from '@/views/Profile.vue'

//管理员
import Admin from "@/pages/admin/index.vue"
import Member from "@/pages/admin/Member.vue"
import EquipmentM from "@/pages/admin/EquipmentM.vue"
import FactoryM2 from "@/pages/admin/FactoryM2.vue"
import Product from "@/pages/admin/Product.vue"

//工厂厂家
import Factory from "@/pages/factory/index.vue"
import Efficiency from "@/pages/factory/Efficiency.vue";
import EquipManage from "@/pages/factory/EquipManage.vue";
import LiveCam from "@/pages/factory/LiveCam.vue";
import OrderManage from "@/pages/factory/OrderManage.vue";

//经销商
import Customer from "@/pages/customer/index.vue"
import Select from "@/pages/customer/select.vue"
import DDm from "@/pages/customer/DDManage.vue"
import Catch from "@/pages/customer/catch.vue"
const routes = [
  {
    path: "/",
    name: "/",
    redirect: "/sign-in",
  },
  {//admin
    path: "/admin",
    name: "Admin",
    component: Admin,
    redirect: "/admin/member",
    children:[
      {
        path: "/admin/member",
        name: "Member",
        component: Member,
      },
      {
        path: "equipmentM",
        name: "EquipmentM",
        component: EquipmentM,
      },
      {
        path: "factoryM2",
        name: "FactoryM2",
        component: FactoryM2,
      },
      {
        path: "product",
        name: "Product",
        component: Product,
      },
    ],
  },
  {
    //工厂厂家
    path: "/factory",
    name: "Factory",
    component: Factory,
    redirect: "/factory/efficiency",
    children: [
      {
        path: "/factory/efficiency",
        name: "Efficiency",
        component: Efficiency,
      },
      {
        path: "equipManage",
        name: "EquipManage",
        component: EquipManage,
      },
      {
        path: "liveCam",
        name: "LiveCam",
        component: LiveCam,
      },
      {
        path: "orderManage",
        name: "OrderManage",
        component: OrderManage,
      },
    ],
  },
  {
    //经销商
    path: "/customer",
    name: "Customer",
    component: Customer,
    redirect: "/customer/select",
    children:[
      {
        path: "/customer/select",
        name: "选标",
        component: Select,
      },
      {
        path: "oorderManage",
        name: "经销商订单管理",
        component: DDm,
      },
      {
        path: "catch",
        name: "经销商订单追踪",
        component: Catch,
      },
    ]
  },
  
  {
    path: "/profile",
    name: "Profile",
    component: Profile,
  },
 
  {
    path: "/sign-in",
    name: "Sign In",
    component: SignIn,
  },
  {
    path: "/sign-up",
    name: "Sign Up",
    component: SignUp,
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
  linkActiveClass: "active",
});

export default router;
